package com.timmy.mvpdemo.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.timmy.mvpdemo.R;
import com.timmy.mvpdemo.interfa.RequestView;
import com.timmy.mvpdemo.presenter.MainActivityPresenter;

/**
 * @author Timmy
 */
public class MainActivity extends AppCompatActivity implements RequestView {

    private static final String TAG = MainActivity.class.getSimpleName();
    private MainActivityPresenter mPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //创建Presenter
        mPresenter = new MainActivityPresenter(this);
        mPresenter.clickRequest();
    }

    @Override
    public void requestLoading() {
        Log.i(TAG, "requestLoading");
    }

    @Override
    public void resultSuccess(String result) {
        Log.i(TAG, "resultSuccess");

    }

    @Override
    public void resultFailure(String result) {
        Log.i(TAG, "resultFailure");
    }
}
